package event

import "reflect"

type Named interface {
	EventName() string
	SetEventName(name string)
}

type Event struct {
	evName string
}

func SetEventNameIfEventNameDefault(ev Named) {
	if ev.EventName() != "" {
		return
	}
	of := reflect.TypeOf(ev)
	evName := of.Name()
	ev.SetEventName(evName)

}

func (e Event) EventName() string {
	return e.evName
}

func (e Event) SetEventName(name string) {
	e.evName = name
}
